/******************************************************************************
* Copyright (C) 2017, Huada Semiconductor Co.,Ltd All rights reserved.    
*
* This software is owned and published by: 
* Huada Semiconductor Co.,Ltd ("HDSC").
*
* BY DOWNLOADING, INSTALLING OR USING THIS SOFTWARE, YOU AGREE TO BE BOUND 
* BY ALL THE TERMS AND CONDITIONS OF THIS AGREEMENT.
*
* This software contains source code for use with HDSC 
* components. This software is licensed by HDSC to be adapted only 
* for use in systems utilizing HDSC components. HDSC shall not be 
* responsible for misuse or illegal use of this software for devices not 
* supported herein. HDSC is providing this software "AS IS" and will 
* not be responsible for issues arising from incorrect user implementation 
* of the software.  
*
* Disclaimer:
* HDSC MAKES NO WARRANTY, EXPRESS OR IMPLIED, ARISING BY LAW OR OTHERWISE,
* REGARDING THE SOFTWARE (INCLUDING ANY ACOOMPANYING WRITTEN MATERIALS), 
* ITS PERFORMANCE OR SUITABILITY FOR YOUR INTENDED USE, INCLUDING, 
* WITHOUT LIMITATION, THE IMPLIED WARRANTY OF MERCHANTABILITY, THE IMPLIED 
* WARRANTY OF FITNESS FOR A PARTICULAR PURPOSE OR USE, AND THE IMPLIED 
* WARRANTY OF NONINFRINGEMENT.  
* HDSC SHALL HAVE NO LIABILITY (WHETHER IN CONTRACT, WARRANTY, TORT, 
* NEGLIGENCE OR OTHERWISE) FOR ANY DAMAGES WHATSOEVER (INCLUDING, WITHOUT 
* LIMITATION, DAMAGES FOR LOSS OF BUSINESS PROFITS, BUSINESS INTERRUPTION, 
* LOSS OF BUSINESS INFORMATION, OR OTHER PECUNIARY LOSS) ARISING FROM USE OR 
* INABILITY TO USE THE SOFTWARE, INCLUDING, WITHOUT LIMITATION, ANY DIRECT, 
* INDIRECT, INCIDENTAL, SPECIAL OR CONSEQUENTIAL DAMAGES OR LOSS OF DATA, 
* SAVINGS OR PROFITS, 
* EVEN IF Disclaimer HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. 
* YOU ASSUME ALL RESPONSIBILITIES FOR SELECTION OF THE SOFTWARE TO ACHIEVE YOUR
* INTENDED RESULTS, AND FOR THE INSTALLATION OF, USE OF, AND RESULTS OBTAINED 
* FROM, THE SOFTWARE.  
*
* This software may be replicated in part or whole for the licensed use, 
* with the restriction that this Disclaimer and Copyright notice must be 
* included with each copy of this software, whether used in part or whole, 
* at all times.
*/

/**************************************************************************//**
* \copyright  Copyright (c) 2013~2099 Ltd.
* \file       FrameInit.c
* \author     谷兴华
* \version    V1.0
* \date       2021年1月30日
* \brief      温度采集板 板级接口定义
* \details    
*             
*
******************************************************************************/
#ifndef __BOARD_TCHC32L13X_H__
#define __BOARD_TCHC32L13X_H__

///< STK GPIO DEFINE
///< USER KEY
//#define STK_USER_PORT       GpioPortD
//#define STK_USER_PIN        GpioPin4

///< LED
#define STK_LED_PORT        GpioPortB
#define STK_LED_PIN         GpioPin2

///< XTH
#define SYSTEM_XTH          (8*1000*1000u)     ///< 32MHz

#define STK_XTHI_PORT       GpioPortD
#define STK_XTHI_PIN        GpioPin0
#define STK_XTHO_PORT       GpioPortD
#define STK_XTHO_PIN        GpioPin1

///< XTL
#define SYSTEM_XTL          (32768u)            ///< 32768Hz
#define STK_XTLI_PORT       GpioPortC
#define STK_XTLI_PIN        GpioPin14
#define STK_XTLO_PORT       GpioPortC
#define STK_XTLO_PIN        GpioPin15

//==== 18B20
#define TC_18B20_EN1_PORT   GpioPortA
#define TC_18B20_EN1_PIN    GpioPin3
#define TC_18B20_IO1_PORT   GpioPortA
#define TC_18B20_IO1_PIN    GpioPin2
#define TC_18B20_EN2_PORT   GpioPortA
#define TC_18B20_EN2_PIN    GpioPin5
#define TC_18B20_IO2_PORT   GpioPortA
#define TC_18B20_IO2_PIN    GpioPin4
#define TC_18B20_EN3_PORT   GpioPortA
#define TC_18B20_EN3_PIN    GpioPin9
#define TC_18B20_IO3_PORT   GpioPortA
#define TC_18B20_IO3_PIN    GpioPin8
#define TC_18B20_EN4_PORT   GpioPortA
#define TC_18B20_EN4_PIN    GpioPin11
#define TC_18B20_IO4_PORT   GpioPortA
#define TC_18B20_IO4_PIN    GpioPin10


//==== N21 PORT
#define TC_N21_YL_PORT   		GpioPortB
#define TC_N21_YL_PIN    		GpioPin5
#define TC_N21_RST_PORT   	GpioPortB
#define TC_N21_RST_PIN    	GpioPin6
#define TC_N21_POWER_PORT   GpioPortB
#define TC_N21_POWER_PIN    GpioPin7
#define TC_N21_RXD_PORT   	GpioPortB
#define TC_N21_RXD_PIN    	GpioPin11
#define TC_N21_TXD_PORT   	GpioPortB
#define TC_N21_TXD_PIN    	GpioPin10

//==== SPI_FLASH PORT
#define TC_FLASH_CE_PORT   		GpioPortB
#define TC_FLASH_CE_PIN    		GpioPin12
#define TC_FLASH_CLK_PORT   	GpioPortB
#define TC_FLASH_CLK_PIN    	GpioPin13
#define TC_FLASH_MISO_PORT   	GpioPortB
#define TC_FLASH_MISO_PIN    	GpioPin14
#define TC_FLASH_MOSI_PORT   	GpioPortB
#define TC_FLASH_MOSI_PIN    	GpioPin15

#endif